<template>
  <van-nav-bar title="查看银行卡信息" left-arrow @click-left="onClickLeft">
    <template #left>
      <van-icon name="arrow-left" style="color: #000; font-size: 24px" />
    </template>
  </van-nav-bar>
<div  class="yhk">
  <div>
     银行名称：{{bankName  }}
  </div>
  <div style="font-size: 16px;">
    银行卡号：{{ '****'+bankCardNumber+'****'}}
  </div>
</div>
</template>
<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { findUserBankCardByUserId } from '../../api/search'
const bankCardNumber:any=ref()
const bankName:any=ref("")
const onClickLeft = () => {
  history.back()
}
const userId = ref(parseInt(localStorage.getItem('userId') as string))
const sessionId = ref(JSON.parse(localStorage.getItem('sessionId') as string))
onMounted(async () => {
  const res = await findUserBankCardByUserId(userId.value, sessionId.value)
  console.log(res.data.result)
  bankCardNumber.value=res.data.result.bankCardNumber.substring(5,15)
  bankName.value=res.data.result.bankName
})
</script>
<style>
.yhk{
  width: 100vw;
  margin: 20px auto;
  height: 250px;
  background: url("../../assets/images/image/hdpi/bank_card.png") no-repeat;
  background-size: 100%;
  margin: 20px auto;
  padding: 20px;
  color: #fff;
}
</style>